package cn.lastcc.toolsCollection.test;

import java.awt.Frame;
import java.awt.Toolkit;
import java.awt.event.MouseEvent;

import javax.swing.event.MouseInputAdapter;

import cn.lastcc.toolsCollection.common.WindowCloseing;
import cn.lastcc.toolsCollection.vessel.DialogButtonType;
import cn.lastcc.toolsCollection.vessel.DialogIconType;
import cn.lastcc.toolsCollection.vessel.MessageDialog;

/**
 * 布局管理器测试窗体<br>
 * <b>请勿删除 <br>
 * Don't Delete this file!!</b>
 * @author baidongyang
 *
 */
public class LayoutTestFrame {

	public static void main(String[] args) {
		LayoutFrame _lf = new LayoutFrame("各种布局管理器的测试");
	}

}

class LayoutFrame extends Frame {

	LayoutFrame (String title) {
		super(title);
		int screenWidth = Toolkit.getDefaultToolkit().getScreenSize().width;
        int screenHeight = Toolkit.getDefaultToolkit().getScreenSize().height;
        this.setBounds(screenWidth / 2 - 400, screenHeight / 2 - 325, 800, 650);
		this.setLayout(null);
		this.addWindowListener(new WindowCloseing(this, true));
		this.addMouseListener(new ClickForm());
		this.setVisible(true);
	}

	private static final long serialVersionUID = -398126689415610578L;

	/* 监听鼠标动作触发事件 */
	class ClickForm extends MouseInputAdapter {

		@Override
		public void mouseClicked(MouseEvent e) {
			MessageDialog.show(e.getX());
			MessageDialog.show(e.getPoint().getX(), "pointX");
			MessageDialog.show(e.getY(), "Y", DialogButtonType.OK);
			MessageDialog.show(e.getPoint().getY(), "pointY", DialogIconType.Warning);
		}
	}
}
